/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tagcloud.component;

/**
 *
 * @author thong
 */
public class ValueVector {
    
    public String word;
    public double[] value;
    
    public ValueVector(String word, int size)
    {
        this.word=word;
        value = new double[size];
    }
    
    public void setValue(int pos, double v)
    {
        value[pos]=v;
    }
    
    public int getWeight()
    {
        double result=0;
        for (int i=0;i<value.length;i++)
        {
            result+=value[i]*value[i];
        }
        return (int)Math.sqrt(result);
    }
}
